//
//  AccountCancellationExplainVC.m
//  Learn
//
//  Created by zyl_macbookpro on 2024/4/6.
//  Copyright © 2024 迟建国. All rights reserved.
//

#import "AccountCancellationExplainVC.h"

@interface AccountCancellationExplainVC ()

@property(nonatomic ,strong)UIScrollView *containView;

@property(nonatomic ,strong)UIButton *agreeBtn;

@end

@implementation AccountCancellationExplainVC

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self renderNavBarWithBackgroundImage:[UIImage imageWithColor:lWhiteColor] backgroundColor:lClearColor shadowColor:nil textAttributeDic:@{NSForegroundColorAttributeName:rgba(51, 51, 51, 1),NSFontAttributeName:MFontWithSize(18)} enableScrollEdgeAppearance:NO];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"撤销同意声明";
    
    [self setBackButtonIsHidden:NO];
    [self.view addSubview:self.containView];
    self.view.backgroundColor = rgba(255, 255, 255, 1);
    UILabel *labelTitle = [[UILabel alloc] init];
    labelTitle.frame = CGRectMake(20,5,lScreenWidth - 40,62);
    labelTitle.numberOfLines = 0;
    [self.containView addSubview:labelTitle];
    NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:@"撤销同意声明"attributes:@{NSFontAttributeName:MFontWithSize(18),NSForegroundColorAttributeName:rgba(51, 51, 51, 1)}];
    labelTitle.attributedText = string;
    labelTitle.textAlignment = NSTextAlignmentLeft;
    
    UILabel *containLabel = [[UILabel alloc] initWithFrame:CGRectMake(20,labelTitle.bottom,lScreenWidth - 40,62)];
    containLabel.numberOfLines = 0;
    NSString *str =
    @"尊敬的用户,请您认真阅读并充分了解相关政策,政策涉及下述内容:\n您可以根据以下目录阅读对应章节，进一步了解本政策的具体内容:\n一、定义与解释\n二、我们如何收集和使用您的个人信息\n三、我们如何使用Cookle\n四、我们如何共享、转让、公开披露您的个人信息\n五、我们如何保护您的个人信息\n六、我们如何存储您的个人信息\n七、您如何实现管理您个人信息的权利\n八、我们如何保护未成年人的个人信息\n九、我们如何更新本政策\n十、如何联系我们\n十一、其他\n您已经同意《学而时习使用协议》、《学而时习隐私政策》和《儿童隐私保护政家》，我们依法尽全力保护您的个人信息";
    NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
    style.lineSpacing = 5;
    NSMutableAttributedString *att = [[NSMutableAttributedString alloc] initWithString:str];
    [att addAttributes:@{NSParagraphStyleAttributeName:style} range:NSMakeRange(0, str.length)];
    containLabel.font = RFontWithSize(14);
    containLabel.textColor = rgba(51, 51, 51, 1);
    containLabel.attributedText = att;
    containLabel.textAlignment = NSTextAlignmentLeft;
    [containLabel sizeToFit];
    
    [self.containView addSubview:containLabel];
    [self.containView addSubview:labelTitle];
    [self.view addSubview:self.agreeBtn];
    
}
- (void)agreeBtnClick
{
    
}
- (UIScrollView *)containView
{
    if (!_containView) {
        _containView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, lTopBarHeight, lScreenWidth, lScreenHeight - lTopBarHeight - lBottomDangerousAreaHeight - 45 - 5)];
        _containView.showsVerticalScrollIndicator = NO;
        _containView.showsHorizontalScrollIndicator = NO;
    }
    return _containView;
}
- (UIButton *)agreeBtn
{
    if (!_agreeBtn) {
        _agreeBtn = ({
            
            UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
            button.frame = CGRectMake(10, self.containView.y + self.containView.height, kScreenWidth - 20, 45);
            [button setTitle:@"撤销同意声明" forState:UIControlStateNormal];
            button.titleLabel.font = MFontWithSize(18.f);
            button.backgroundColor = rgba(239, 78, 92, 1);
            [button setTitleColor:lWhiteColor forState:UIControlStateNormal];
            [button addTarget:self action:@selector(agreeBtnClick) forControlEvents:UIControlEventTouchUpInside];
            [button setAllCornersWithCornerRadius:22.5];
            button;
            
        });
    }
    return _agreeBtn;
}


@end
